Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test for history config #6334

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

Shaddoll
Copy link
Member

@Shaddoll Shaddoll commented Oct 7, 2024

What changed?

  • Add unit test for history config
  • Clean up unused dynamic configs

Why?
Improve test coverage

How did you test it?
unit tests

Potential risks

Release notes

Documentation Changes

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.50%. Comparing base (a155019) to head (a134cbe).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
service/history/config/config.go 66.66% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
service/history/config/config.go 79.06% <66.66%> (ø)

... and 28 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a155019...a134cbe. Read the comment docs.

Copy link
Member

@timl3136 timl3136 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Shaddoll Shaddoll merged commit f9e8453 into cadence-workflow:master Oct 7, 2024
19 of 20 checks passed
@Shaddoll Shaddoll deleted the test branch October 7, 2024 20:59
@@ -308,7 +279,6 @@ type Config struct {
// EnableContextHeaderInVisibility whether to enable indexing context header in visibility
EnableContextHeaderInVisibility dynamicconfig.BoolPropertyFnWithDomainFilter

EnableCrossClusterEngine dynamicconfig.BoolPropertyFn
EnableCrossClusterOperationsForDomain dynamicconfig.BoolPropertyFnWithDomainFilter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kinda surprising this doesn't go away, if the whole cross-cluster thing is gone

Comment on lines +262 to +274
"GlobalRatelimiterGCAfter": {dynamicconfig.HistoryGlobalRatelimiterGCAfter, time.Second},
"HostName": {nil, hostname},
}
client := dynamicconfig.NewInMemoryClient()
for fieldName, expected := range fields {
if expected.key != nil {
err := client.UpdateValue(expected.key, expected.value)
if err != nil {
t.Errorf("Failed to update config for %s: %s", fieldName, err)
}
}
}
dc := dynamicconfig.NewCollection(client, testlogger.New(t))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda wonder if this would be better to do as a "pick a hashed value for whatever key was requested"... the keys and values sorta don't matter, just that they're predictable and come from the dynamic config.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the values have types. And the type matters.

timl3136 pushed a commit to timl3136/cadence that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants